package com.company.aspect;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.company.dao.Company;
import com.company.exception.DAOException;
import com.company.exception.ServiceException;
import com.company.service.CompanyService;

public class Standalone {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("test-applicationContext.xml");
		
		CompanyService companyService = (CompanyService) context.getBean("companyService");		

		Company company = new Company();
		company.setId(1);
		company.setName("company : " + Math.random());
		
		try {
			companyService.saveCompany(company);
						
			
		} catch (ServiceException e) {			
			e.printStackTrace();
		} catch (DAOException e) {			
			e.printStackTrace();
		}
	}

}
